package com.code.responsibility;

import com.code.responsibility.handle.Ceo;
import com.code.responsibility.handle.Director;
import com.code.responsibility.handle.Manager;
import com.code.responsibility.handle.PriceHandler;
import com.code.responsibility.handle.Sales;
import com.code.responsibility.handle.VicePresident;

/**
 * <p>价格处理人</p>
 *
 * @author hwf
 * @version 1.0
 * @date 2021/12/14 22:05
 */

public class PriceHandlerFactory {

    public static PriceHandler createPriceHandle() {

        PriceHandler sales = new Sales();
        PriceHandler manager = new Manager();
        sales.setSuccessor(manager);
        PriceHandler director = new Director();
        manager.setSuccessor(director);
        PriceHandler vicePresident = new VicePresident();
        director.setSuccessor(vicePresident);
        PriceHandler ceo = new Ceo();
        vicePresident.setSuccessor(ceo);
        return sales;
    }
}
